# -*- coding: utf-8 -*-
import cv2

#读入原始图片（高斯图片）
i1 = cv2.imread("images/cv_gaussian_noise.jpg")

#反转图片
flipi = cv2.flip(i1, -1)

#进行高斯滤波
img = cv2.GaussianBlur(flipi, (9, 9), 0)

cv2.imshow("Gaussian", i1)
cv2.imshow("img", img)

#读取原始椒盐图片
i2 = cv2.imread("images/cv_salt_noise.jpg")
cv2.imshow("Salt1", i2)

#反转图片
flipi2 = cv2.flip(i2, 1)

#调用中值滤波函数
img2 = cv2.medianBlur(flipi2, 7)
cv2.imshow("Salt2", img2)

cv2.waitKey(0)
cv2.destroyAllWindows()
